#!/usr/bin/perl
#
$tillSen=$ARGV[0];

while($line=<STDIN>) {
	if($line=~/Predicted/) {
		$p++;
	}
	elsif($line=~/Successful/) {
		$s++;
		if($line=~/Local/) {
			$z++;
		}
	}
	elsif($line=~/Failure/) {
		$f++;
	}
	elsif($line=~/UnReachable/) {
		$u++;
	}

	if($tillSen && $line=~/TRAIN.*\($tillSen\)/) {
		last;
	}
}
print "P=$p\tS=$s(L=$z)\tF=$f\tU=$u\n";
